#include<iostream>

class Complex
{
private:
    float real;
    float unreal;
public:
    Complex() {}
    Complex(float real,float unreal) :real(real),unreal(unreal) {}
    void Print()
    {
        std::cout<<real<<'+'<<unreal<<'i'<<std::endl;
    }
    friend Complex operator +(Complex &complex1,Complex &complex2);
    friend Complex operator +(Complex &complex1,float temporary);
    friend Complex operator +(float temporary,Complex &complex1);
    friend Complex operator -(Complex &complex1,Complex &complex2);
};

Complex operator +(Complex &complex1,float temporary)
{
    return Complex(complex1.real+temporary,complex1.unreal);
}

Complex operator +(float temporary,Complex &complex1)
{
    return Complex(complex1.real+temporary,complex1.unreal);
}

Complex operator +(Complex &complex1,Complex &complex2)
{
    return Complex(complex1.real+complex2.real,complex1.unreal+complex2.unreal);
}

Complex operator -(Complex &complex1,Complex &complex2)
{
    return Complex(complex1.real-complex2.real,complex1.unreal-complex2.unreal);
}


int main()
{
    Complex complex1(1,2),complex2(3,4);
    Complex complex3=complex1+complex2;
    complex1.Print();
    complex2.Print();
    (complex1+complex2).Print();
    complex3.Print();
    (complex1+10).Print();
    (10+complex1).Print();
    return 0;
}